<?php
extract(array(
	'items' => array(),
	'type' => 'dropdown', // select or dropdown
	'selected' => '',
	'show_option_none' => 'Please select',
	'class' => 'wrapper-dropdown',
	'rev' => 'pagination_contents',
), EXTR_SKIP);
/*
 * Items format
 * array(
 *		'value' => array(
 *			'label' => 'Label',
 *			'href' => 'http://www.google.com', // for dropdown type
 *			'class' => 'item-class', // for dropdown type
 *		)
 * )
 */

if ( $type == 'select' ) {

} elseif ( $type == 'dropdown' ) {

	if ( !empty($selected) && !empty($items[$selected]) ) {
		$show_option_none = $items[$selected]['label'];
	}
		
?>
<div class="<?php echo $class ?>">
	<span><?php echo $show_option_none ?></span>
	<ul class="dropdown">
		<?php foreach ($items as $value => $item) : ?>
			<li><a class="<?php echo @$item['class'] ?>" rev="<?php echo $rev ?>" href="<?php echo @$item['href'] ?>"><?php echo @$item['label'] ?></a></li>
		<?php endforeach; ?>
    </ul>
</div>

<?php 
	}
?>